const app = getApp()


Page({
  data: {
    imgUrls: [
      'http://phtvvz9br.bkt.clouddn.com/jbc/home/banner.jpg',
      'http://phtvvz9br.bkt.clouddn.com/jbc/home/banner.jpg',
      'http://phtvvz9br.bkt.clouddn.com/jbc/home/banner.jpg'
    ],
    select: false,
    tihuoWay: '佛山',
    indicatorDots: true,
    autoplay: false,
    interval: 5000,
    duration: 1000,
    url: app.getUrl.Urlcom


  },
  changeIndicatorDots: function (e) {
    this.setData({
      indicatorDots: !this.data.indicatorDots
    })
  },
  changeAutoplay: function (e) {
    this.setData({
      autoplay: !this.data.autoplay
    })
  },
  intervalChange: function (e) {
    this.setData({
      interval: e.detail.value
    })
  },
  durationChange: function (e) {
    this.setData({
      duration: e.detail.value
    })
  },

  /**
  * 生命周期函数--监听页面加载
  */
  onLoad: function () {
    app.editTabBar();    //显示自定义的底部导航  
    this.home_class();//查询品牌
    this.home_rec();//推荐车辆
    this.home_high();//最低首付
    this.home_high1();//最低首付1
    this.home_low();//最低月供
    this.home_low1();//最低月供1
    this.home_direct();//最高直降
    this.home_direct1();//最高直降1
    this.browsing_history();//浏览记录
  },

  //查询品牌分类
  home_class:function(){
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/index/home_class.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        that.setData({
          classname: res.data
        })
      },
    })

  },
  //推荐车辆
  home_rec: function () {
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/index/home_rec.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        // console.info(res.data)
        that.setData({
          tuijian: res.data
        })
      },
    })

  },
  //最低首付
  home_high: function () {
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/index/home_high.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        // console.info(res.data)
        that.setData({
          zuidishoufu: res.data
        })
      },
    })

  },
  //最低首付1
  home_high1: function () {
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/index/home_high1.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        // console.info(res.data[0])
        that.setData({
          zuidishoufu1: res.data
        })
      },
    })

  },
  //最低月供
  home_low: function () {
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/index/home_low.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        // console.info(res.data)
        that.setData({
          yuegong: res.data
        })
      },
    })

  },
  
  //最低月供1
  home_low1: function () {
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/index/home_low1.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        // console.info(res.data)
        that.setData({
          yueong1: res.data
        })
      },
    })

  },
  //最高直降
  home_direct: function () {
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/index/home_direct.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        that.setData({
          direct: res.data
        })
      },
    })

  },

  //最高直降
  home_direct1: function () {
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/index/home_direct1.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        that.setData({
          direct1: res.data
        })
      },
    })

  },
  
  //浏览历史
  browsing_history: function () {
    var that = this;
    wx.request({
      url: app.getUrl.Urlcom + '/Home/index/browsing_history.html', //真实的接口地址
      method: 'GET',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function (res) {
        that.setData({
          browsing_history: res.data
        })
      },
    })

  },

  monthlyhot:function(){

    // console.info('11');
    wx.navigateTo({
      url: '../monthlyhot/monthlyhot',     
      })
  },

  //下拉地址

  bindShowMsg() {
    this.setData({
      select: !this.data.select
    })
  },
  mySelect(e) {
    var name = e.currentTarget.dataset.name
    this.setData({
      tihuoWay: name,
      select: false
    })
  },
 








})